<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('tasks', function (Blueprint $table) {
            $table->id();
            $table->string('name', 50);
            $table->unsignedTinyInteger('type')->default(0);
            $table->unsignedTinyInteger('status')->default(0);
            $table->text('params')->nullable();
            $table->unsignedInteger('user_id');
            $table->unsignedInteger('papper_id');
            $table->date('agreement_at')->nullable()->comment('约定完成时间');
            $table->unsignedSmallInteger('number1')->default(0);
            $table->unsignedSmallInteger('number2')->default(0);
            $table->unsignedInteger('number3')->default(0);
            $table->unsignedTinyInteger('pinggu_status')->default(0);
            $table->date('pinggu_date')->nullable();
            $table->unsignedSmallInteger('sort')->default(50);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('tasks');
    }
};
